﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace WuDada.Trade.DataLoader.Domain
{
    /// <summary>
    /// 股票歷史資料
    /// </summary>
    [Serializable]
    [DataContract]
    public class StockDataVO
    {
        public StockDataVO()
        {
        }

        public StockDataVO(DateTime date, string stockCode, StockDataPeriod period)
        {
            this.DataTime = date;
            this.StockCode = stockCode;
            this.Period = period;
        }

        /// <summary>
        /// 識別碼
        /// </summary>
        public virtual int StockDataId { get; set; }

        /// <summary>
        /// 股票代碼
        /// </summary>
        public virtual string StockCode { get; set; }

        /// <summary>
        /// 資料週期
        /// </summary>
        public virtual StockDataPeriod Period { get; set; }

        /// <summary>
        /// 資料日期/時間
        /// </summary>
        public virtual DateTime DataTime { get; set; }

        /// <summary>
        /// 開
        /// </summary>
        public virtual double OpenValue { get; set; }

        /// <summary>
        /// 高
        /// </summary>
        public virtual double HighValue { get; set; }

        /// <summary>
        /// 低
        /// </summary>
        public virtual double LowValue { get; set; }

        /// <summary>
        /// 收
        /// </summary>
        public virtual double CloseValue { get; set; }

        /// <summary>
        /// 成交量
        /// </summary>
        public virtual double Volume { get; set; }

        /// <summary>
        /// 資料週期類型
        /// </summary>
        public enum StockDataPeriod
        {
            /// <summary>
            /// 日線
            /// </summary>
            Day = 0,

            /// <summary>
            /// 一分鐘線
            /// </summary>
            Min1 = 1,

            /// <summary>
            /// 五分鐘線
            /// </summary>
            Min5 = 2
        }
    }
}
